<?php
/**
 *  core.php 入口文件
 *
 * @copyright	(c) 2011 Movie All rights reserved.
 * @author		Feng <dcsite@qq.com> <QQ:729913515>
 * @lastmodify	2011-04-05 22:29:27
 */

$mtime = explode(' ', microtime());
$starttime = $mtime[0] + $mtime[1];
// set_magic_quotes_runtime(0);
error_reporting(0); 
//error_reporting (E_ALL);
header("Content-Type: text/html; charset=utf-8");
date_default_timezone_set('Asia/Shanghai');

if (version_compare( '5.2', phpversion(), '>' ))
    die( '您的服务器运行的 PHP 版本是' . phpversion() . ' 本系统要求至少5.2' );

if(!extension_loaded('mysql'))
    die( '没有找到 MySQL 数据库');

isset($_REQUEST['GLOBALS']) or isset($_FILES['GLOBALS']) && exit('Request tainting attempted.');
unset($_ENV, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_ENV_VARS);
define('DCS_ROOT',substr(dirname(strtr(__FILE__,'\\','/')),0,-4));
require_once (DCS_ROOT."core/common/config.php");
//session_cache_limiter("private,must-revalidate");	
session_set_cookie_params(24 * 3600); 
session_start();
session_save_path(PUBLIC_PATH.'cache/session/'); 

//function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();

require_once CLASS_PATH."common/funs.php";

$timestamp = time();
$onlineip = getIp();
$urlRouter = urlRouter();

if (ini_get('register_globals')) {
    isset($_REQUEST['GLOBALS']) && die('发现试图覆盖 GLOBALS 的操作');
    $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE','_SERVER', '_ENV', '_FILES');
    $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
    foreach ( $input as $k => $v ) {
        if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) {
            $GLOBALS[$k] = NULL;
            unset($GLOBALS[$k]);
        }
    }
}


if (get_magic_quotes_gpc() == 0){
    $_POST    = daddslashes($_POST);
    $_GET     = daddslashes($_GET);
    $_COOKIE  = daddslashes($_COOKIE);
}
?>
